# It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Desktop Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script o copy files and or folders from a file share on a Windows Server to the directory on Mac endpoints # Parameters - " - Path to the network share(where the file or folder is present)>" # Example - "smb://administrator:password@172.21.201.118/D/Srinath" # " - Path to the Mac agent to mount the share" # Example - "/Users/swedha-7688/testshare" # " - File/Folder name" # Example - "examplefiles.text" # " - Path to the mac agent to copy the files" # Example - "/Users/Shared" # Configuration Type - USER/COMPUTER # !/usr/bin/bash SERVERPATH=$1 MOUNTTO=$2 FILEORFOLDERNAME="$2"/"$3" COPYTO=$4 mount -t smbfs "$SERVERPATH" "$MOUNTTO" cp -R "$FILEORFOLDERNAME" "$COPYTO" errcode=$? if [ "$errcode" -ne 0 ]; then echo "" echo "Failed to copy with errorcode $errcode" 1>&2 echo "" exit 1 fi echo "Successfully copied at $COPYTO" 1>&2